This article describes the screenY, pageY, clientY, layerY, and offsetY attributes of mouse events. For more information, see
ScreenY
Offset between the mouse and the upper left corner of the screen
PageY
The offset between the mouse and the upper left corner of the page (its value is not affected by the scroll bar)
This attribute is not supported under IE9
However, you can write some code to calculate it.
This article describes the screenY, pageY, clientY, layerY, and offsetY attributes of mouse events. For more information, see
ScreenY
Offset between the mouse and the upper left corner of the screen
PageY
The offset between the mouse and the upper left corner of the page (its value is not affected by the scroll bar)
This attribute is not supported under IE9
However, you can write some code to calculate it.
ScreenY, pageY, clientY, layerY, offsetY attribute details of mouse events, screenyoffsety
ScreenY
Offset between the mouse and the upper left corner of the screen
PageY
The offset between the mouse and the upper left corner of the page (its value is not affected by the scroll bar)
This attribute is not supported under IE9
However, you can write some code to calculate it. Implementation in jQuery:
Copy cod
1 Pagex,pagey: The calculation area includes the control and scroll bars of the window itself relative to the x, Y coordinates of the current window. (Unique to Firefox)2 Event.clientx,event.clienty: The mouse pointer is different from the x, y coordinates of the current window, and the page differs from the control and scroll bars of the window itself, which are not included in the calculation area.3 event. X and Event.y: Sets or gets the x, y pixel coordinates of the position of the mouse poin
property.2. In the case where the element has an upper border border-top, the layery is one more border-top than the value of offsety.1 var offsetY = event.offsety| | (Event.layery +element.bordertopwidth); 2 // Note that the element.bordertopwidth here need to be replaced with the width of the top border of the calculated element. The Layery and OffsetY properties make it easy to calculate the offset of the mouse relative to the bound mouse event element, which is useful at some point.Here in
What are the differences between clientx, clienty, offsetx, offsety, screenx, screeny, X, and Y?
Clientx, clienty is the current position of the mouse relative to the webpage. When the mouse is in the upper left corner of the page, clientx = 0 and clienty = 0;
Offsetx and offsety are the positions of the current mouse relative to a certain area in the webpage. When the mouse is located in the upper left corner of the area in the page, offsetx = 0 an
ClientX: When a mouse event occurs (either onclick, omousemove,onmouseover, etc.), the mouse is positioned relative to the x-axis of the browser (which is said to be the active area of the browser);
ClientY: When a mouse event occurs, the mouse is positioned relative to the y-axis of the browser (which is what it says is the active area of the browser);
ScreenX: The position of the mouse relative to the x-axis of the display screen when the mouse event occurs;
ClientX, clientY is the current position of the mouse relative to the webpage. When the mouse is in the upper left corner of the page, clientX = 0 and clientY = 0;
OffsetX and offsetY are the positions of the current mouse relative to a certain area in the webpage. When the mouse is located in the upper left corner of the area in the page, offsetX = 0 and offsetY = 0;
ScreenX and screenY are relative to the user's display.
X and y are the locations of
.
DisplayClientX:
DisplayClientY:
4. Set or get the cursor position (triggered node testid1) to its own node (testid1)Inner Boundary(Including the rolling distance, that is, the Invisible Area)
DisplayOffsetXOr ff layerX:
DisplayOffsetYOr ff layerY:
5. set or obtain the distance from the mouse pointer position (triggered node testid1) to the screen by screenX and screenY
Show screenX:
Show screenY:To sum up, the coordinates are used to figure out what
ScreenY
Offset of the mouse relative to the top left corner of the display screen
Pagey
The offset of the mouse relative to the upper-left corner of the page (its value is not affected by the scroll bar)
This attribute is not supported under IE9
But you can write some code to calculate it. Implementation in jquery:
Copy Code code as follows:
Calculate pagex/y if missing and clientx/y available
if (Event.pagex = = null original
], points [0], 0x6666cc); triangles [1] = New Triangle (points [0], points [2], points [3], 0x6666cc );
Or
Triangles [0] = New Triangle (points [1], points [2], points [3], 0x6666cc); triangles [1] = New Triangle (points [1], points [3], points [0], 0x6666cc );
As long as the clockwise rule is satisfied, you can. OK, half of the success has been made. How can we determine if the triangle is on the back?
// Determine whether the private function isbackface (): Boolean {var CAX: Number = p
1. Define a maptoolaction to implement the click function. Obtain the basic information of the vertex to be displayed in maptoolaction and save it to webcontext.
// Obtain the click point and save the information as simplepointinfo_ Context =Event. getwebcontext ();Webmap map =_ Context. getwebmap ();Webpoint screenpoint = (webpoint)Event. getwebgeometry ();Webpoint mappoint = (webpoint)Event. getwebgeometry (). tomapgeometry (MAP );SimplepointinfoPointinfo = newSimplepointinfo ();Pointinfo. set
area on the System screen, including any system elements, such as the taskbar. Because features such as height, width, innerheight, and innerwidth cannot accurately describe the window boundary, the approximate pixel value must be subtracted.
To make full use of the fullscreen feature of the browser, simply add the following script program:
VaR STR = "Left = 0, screenx = 0, Top = 0, screeny = 0, fullscreen ";
We do not need to check whether the brows
The difference between Clientx/clienty and Screenx/screeny
There are times in JavaScript where we need to get the mouse hover position to do some special processing. The MouseEvent object needs to be used. The MouseEvent object provides two sets of properties for locating the position of the mouse: Clientx/clienty and Screenx/screeny. In addition to these two sets of properties we often use Pagex/p
. The purpose of introducing the Self object is only to correspond to the top and parent objects, so it does not contain extra values.All of these objects are properties of the Window object and can be accessed in the form of Window.parent, Window.top, and so on. At the same time, this also means that different levels of window objects can be concatenating up, such as window.parent.parent.frames[0].Window positionThere are many properties and methods used to determine and modify the location of
{
This. Cx = Cx; this. Cy = Cy; this. cz = cz ;}
Public Function setvanishingpoint (vpx: Number, vpy: Number): void {
This. vpx = vpx; this. vpy = vpy ;}
Public Function get screenx (): number {
VaR scale: Number = fL/(FL + Z + cz );
Return vpx + cx + x * scale ;}
Public Function get screeny (): number {
VaR scale: Number = fL/(FL + Z + cz );
Return vpy + Cy + y * scale;
} Public function rotatex (anglex: Number): void {
VaR cosx: Number = math. Co
Welcome to the CSDN-markdown Editor, csdn-markdownDifference between clientX/clientY and screenX/screenY
In JavaScript, we sometimes need to get the cursor position for some special processing. In this case, the MouseEvent object is used. The MouseEvent object provides two sets of attributes to locate the mouse position: clientX/clientY and screenX/screenY. In addition to these two sets of attributes, we
event.var event = document.createevent (' mouseevents '); This parameter can be selected as follows:
Uievents
Mouseevents
Mutationevents, generalized DOM changes
Htmlevents General DOM Events
var type = ' click '; Type of event to trigger var bubbles = true; Whether the event can bubble var cancelable = true; Whether the event can block browser default event var view = Document.defaultview; The view associated with the event, which is default, regardless of var detail
touch point relative to the browser window viewport2.pagex/pagey://the position of the touch point relative to the page3.screenx/screeny://the position of the touch point relative to the screen4.identifier://Touch object's unique ID
Touchstart Event
function Touchsatrtfunc (e) {
//evt.preventdefault ();///Prevent browser zoom, scroll bar scrolling, etc. var touch when touching
= E.touches[0]; Gets the first contact
var x = number (To
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.